from client.bulletsystem.projectile import Projectile
from server.sessionstuff.webentities import webprojectile
from client.utils import assethandling


def get_projectile_data(name):
    if name == "Bullet":
        return ProjectileData("Bullet", 20, True, 4)
        #UnitData(name, speed, radius, hp, worth, upgrades[], cost, amount)


def create_projectile(name, target, manager):
	data = get_projectile_data(name)
	projectile = Projectile(name, assethandling.createBullet(), data.speed, target, manager)
	return projectile


def create_web_projectile(name, pos, target, manager):
	data = get_projectile_data(name)
	projectile = webprojectile.WebProjectile(data.name, data.basedamage, data.has_flighttime, data.speed, pos, target, manager)
	return projectile


class ProjectileData():

	def __init__(self, name, basedamage, has_flighttime, speed):
		self.name = name
		self.basedamage = basedamage
		self.has_flighttime = has_flighttime
		self.speed = speed